package com.letu.mq.listener;

import com.letu.mq.model.MySimpleMessage;
import com.letu.mq.service.BusinessPointService;
import com.letu.mq.util.MessageExtUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Description: 单个业务类型发送
 */
@Slf4j
//@RocketMQMessageListener(topic = "${rocketmq.consumer.orderConsumer}", consumerGroup = "${spring.application.name}",
//        selectorExpression = "${rocketmq.tags}",
//        messageModel = MessageModel.CLUSTERING, consumeMode = ConsumeMode.ORDERLY)
public class OrderBusinessPointListner implements RocketMQListener<MySimpleMessage> {

    @Autowired
    private BusinessPointService businessPointService;

    @Override
    public void onMessage(MySimpleMessage message) {
        businessPointService.execute(message);
    }

}
